package com.example.controller;

import com.example.domain.TUser;
import com.example.service.TUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * (TUser)控制层
 *
 * @author zhuyonggang
 * @since 2021-09-08 23:05:02
 */
@RestController
@RequestMapping("tUser")
public class TUserController {
    @Autowired
    private TUserService tUserService;

    @PostMapping("/insert")
    public String insert(@RequestBody TUser user) {
        this.tUserService.save(user);
        return "成功";
    }

    @PostMapping("/list")
    public String list() {
        List<TUser> list = this.tUserService.list();
        System.out.println(list);
        return "成功";
    }
}
